<?php
abstract class info_module extends module {
	public $parent = null;
	protected $_db = null;
	public $db_name = null;
	final public function __construct($db_name) {
		$this->name = get_class($this);

		if (!isset($_GLOBALS['db'])) {
			$_GLOBALS['db'] = null;
		}
		$this->_db =& $_GLOBALS['db'];
		$this->db_name = $this->_db->quote($db_name);
		
		if (is_callable(array(&$this,'_run'))) $this->_run();
	}
	private function update_value ($index, $values) {
		$sql = "UPDATE $this->db_name SET ";
		foreach ($values as $key => $val) {
			$sql .= $this->_db->quote($key) . " = " . $this->_db->quote($val) . " ";
		}
		$sql .= "WHERE " . $this->_db->quote(key($index)) . " = " . $this->_db->quote($index[0]);
		$this->_db->query($sql);
	}
	private function retrive_value ($index, $fields) {
		
	}
}
?>